#include "clkShape.h"

void clkPolygon::initRect(float a_width, float a_height, V2DF a_center)
{
	m_type = SHAPE_POLYGON;

	float hw = a_width/2.0f;
	float hh = a_height/2.0f;

	m_verts[0].set(-hw,-hh);
	m_verts[1].set(hw,-hh);
	m_verts[2].set(hw,hh);
	m_verts[3].set(-hw,hh);

	m_norms[0].set(0.0f,-1.0f);
	m_norms[1].set(1.0f,0.0f);
	m_norms[2].set(0.0f,1.0f);
	m_norms[3].set(-1.0f,0.0f);

	m_vertCount = VERT_MAX;
	for(int i = 0; i < m_vertCount; i++)
		translateVec(m_verts[i],a_center);
}